import createPersistedState from 'vuex-persistedstate'
import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    userInfo: {},
    text: ''
  },
  getters: {
    getUserInfo(state) {
      return state.userInfo
    },
    getText(state) {
      return state.text
    },
  },
  mutations: {
    setUserInfo: (state, data) => {
      state.userInfo = data
    },
    setText(state, data) {
      state.text = data
    },
  },
  actions: {},
  modules: {},
  plugins: [createPersistedState()]
});
